package com.zhejiangzhengyuan.municipal_common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 警报事件表，存储物联网或人工上报的警报事件数据
 *
 * @author linju
 * @since 2019-11-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "WarnEvent对象", description = "警报事件表，存储物联网或人工上报的警报事件数据")
public class WarnEvent extends Model<WarnEvent> {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "自增主键")
  @TableId(value = "id", type = IdType.AUTO)
  private Long id;

  @ApiModelProperty(value = "基本分为：系统报警、手机端上报、PC端上报；关联字典条目表")
  private String dataOrigin;

  @ApiModelProperty(value = "设备表主键做外键")
  private Long deviceId;

  @ApiModelProperty(value = "可以按照设备类型进行分类，关联字典条目表")
  private String type;

  @ApiModelProperty(value = "告警等级，根据系统业务填写")
  private String level;

  @ApiModelProperty(value = "告警原因")
  private String reason;

  @ApiModelProperty(value = "告警内容描述")
  private String context;

  @ApiModelProperty(value = "上报人，系统报警没有上报人，为用户表外键")
  private Long reportUserInfoId;

  @ApiModelProperty(value = "备注")
  private String remark;

  @ApiModelProperty(value = "是否复位")
  private boolean reset;

  @ApiModelProperty(value = "复位原因")
  private String resetReason;

  @ApiModelProperty(value = "记录创建时间")
  private Timestamp createTime;

  @ApiModelProperty(value = "记录更新时间")
  private Timestamp updateTime;

  @ApiModelProperty(value = "是否派单，默认为否")
  private boolean sendOrder;

  @ApiModelProperty("定位")
  @TableField(exist = false)
  private String location;

  @Override
  protected Serializable pkVal() {
    return this.id;
  }
}
